<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>评论界面</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="/static/css/layui.css">
	<link rel="stylesheet" href="/static/css/mian.css">
</head>
<body class="lay-blog">
{{ template "common/head.html" . }}
		<div class="container-wrap">
			<div class="container container-message container-details container-comment">
					<div class="contar-wrap">
						<div class="item">
							<div class="item-box  layer-photos-demo1 layer-photos-demo">
								<h3>{{ .node.Title }}</h3>
								<h5>发布于：<span>{{ date .node.UpdatedAt "Y-m-d H:i:s"}}</span></h5>
								<p>{{ .node.Summary }}</p>
								<div class="count layui-clear">
									<span class="pull-left">阅读 <em>100000+</em></span>
									<span class="pull-right like"><i class="layui-icon layui-icon-praise"></i><em>999</em></span>
								</div>
							</div>
						</div>	
						<form class="layui-form" action="">
							<div class="layui-form-item layui-form-text">
								<input type="text" name="key" value="{{.node.Uuid }}" style="display: none">
							</div>
							<div class="layui-form-item layui-form-text">
								<textarea  name="content" class="layui-textarea"  style="resize:none" placeholder="写点什么啊"></textarea>
							</div>
							<div class="btnbox">
								<button class="layui-btn text-center" lay-submit lay-filter="sure">确定</button>
							</div>
						</form>
					</div>
			</div>
		</div>
{{ template "common/footer.html" . }}
<script src="/static/layui/layui.js"></script>
<script>
	layui.config({
		base: '/static/js'
	}).use('blog');
</script>
<script language="JavaScript">
	layui.use(['form','jquery'], function(){
		var form = layui.form,
				$=layui.$;
		form.render();
		//监听提交
		form.on('submit(sure)', function(rdata){
			$.post("/Auth/Comment",rdata.field,function (data){
				if (data.code===0){
					layer.msg("评论成功");
					if(data.action){
						setTimeout(function (){
							window.location.href=data.action
						},300)
					}
				}else {
					layer.msg("评论失败");
				}
			},"json").error(function (){
				layer.msg("网络异常");
			})
			return false;
		})
	})
</script>
</body>
</html>